<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Groovy Configuration</title>

<style type="text/css">
html,body{
	width: 100%; height: 100%; overflow: hidden;
}
html,body,span,div{
	font-family: "Microsoft YaHei",SimSun,Arial,Helvetica,sans-serif; font-size: 12px;
	margin: 0px; padding: 0px; border: 0px;
}

div.item{
	width: calc(100% - 25px);
	height: 100px; height: calc(100% - 10px);
	margin-top: 10px; margin-left: 15px;
}

span.title {
	height: 16px; line-height: 16px; display: block;
}

div.item textarea{
	width: 98%; width: calc(100% - 6px);
	height: 100%; height: calc(100% - 22px);
}
</style>

<script type="text/javascript">

/**
 * 修改配置时，系统会自动把上次存储的配置值（字符串），返还给你，具体填充到form自行负责
 */
function init(config){
	
	try {
	
		if(!config){
			config = parent.currentTr.find("#ConfigValue").val();
		}
		
		config = decodeURIComponent(config);
		
		document.getElementById("script_content").value = config;
	} catch(error){
		alert(error);
	}
	
}

/**
 * 将配置值自行拼接成字符串返回给表单，表单负责存储，具体格式没有要求，自行决定
 * @return string
 */
function OK(){
	
	try {

		var scriptContent = document.getElementById("script_content").value;
		
		return encodeURIComponent(scriptContent);
	} catch(error){
		alert(error);
	}
}

</script>

</head>
<body onload="init()">
	<div class="item">
		<span class="title">Groovy 脚本:</span>
		<textarea name="script_content" id="script_content"></textarea>
	</div>
</body>
</html>